import {defineStore} from 'pinia'
import {Names} from './store-name'
export const VaeStore=defineStore(Names.StoreName,{
    state:()=>{
        return{
            clientWidth:0,//屏幕宽
            isPC:false,//是否pc端
            clientHeight:0,//屏幕高
            activeKey:"",//当前页面
            mydarkTheme:false,//当前页面
        }
    },
    //类似computed 修饰一些值
    getters:{
        getClientWidth():number{
           return this.clientWidth
        }
    },
    //methods 可以同步异步 提交state
    actions:{
        setclientWidth(num:number){
            this.clientWidth=num;
            this.isPC= num>1020? true:false;
            
        },
        setclientHeight(num:number){
            this.clientHeight=num
        },
        setactiveKey(key:string){
            this.activeKey=key
        }
    }


})